import java.util.concurrent.locks.ReentrantReadWriteLock;

public class Mythread implements Runnable{
    public static ReentrantReadWriteLock.ReadLock readlock = new ReentrantReadWriteLock().readLock();
    public static ReentrantReadWriteLock.WriteLock writelock = new ReentrantReadWriteLock().writeLock();
    @Override
    public void run() {
        while (true){
            readlock.lock();
            System.out.println(Thread.currentThread().getName()+":readlock");
            Object test1 = TmpTest.data.get("test1");
            System.out.println(Thread.currentThread().getName()+":========get"+test1);
            System.out.println(Thread.currentThread().getName()+":readunlock");
            readlock.unlock();
        }

    }
}